﻿
Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class FrontEnd_Control_Users_DetailTinNhanDen
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If (Not Page.RouteData.Values("Id") Is Nothing) Then

                hidID.Value = Page.RouteData.Values("Id")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p As TinNhan = (From q In data.TinNhans Where q.Id = hidID.Value Select q).FirstOrDefault
            If Not p Is Nothing Then
                lblTieude.Text = IIf(IsNothing(p.TieuDe) = True, "", p.TieuDe)
                lblNoidung.Text = IIf(IsNothing(p.NoiDung) = True, "", p.NoiDung)
                lblUserid.Text = IIf(IsNothing(p.UserId) = True, "", p.UserId)
                lblRaovatid.Text = IIf(IsNothing(p.RaoVatId) = True, "", p.RaoVatId)
                lblCreated.Text = IIf(IsNothing(p.Created) = True, "", p.Created)
            End If
        End Using
    End Sub
#End Region
End Class
